home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / AIncludes / Palettes.a < prev    next >
Text File  |  1996-05-01  |  9KB  |  409 lines

  1. ;
  2. ;    File:        Palettes.a
  3. ;
  4. ;    Contains:    Palette Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0d3 on Copland DR1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        If you find a problem with this file, send the file and version
  12. ;                information (from above) and the problem description to:
  13. ;
  14. ;                    Internet:    apple.bugs@applelink.apple.com
  15. ;                    AppleLink:    APPLE.BUGS
  16. ;
  17. ;
  18.     IF &TYPE('__PALETTES__') = 'UNDEFINED' THEN
  19. __PALETTES__ SET 1
  20.  
  21.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  22.     include 'Quickdraw.a'
  23.     ENDIF
  24.     IF &TYPE('__WINDOWS__') = 'UNDEFINED' THEN
  25.     include 'Windows.a'
  26.     ENDIF
  27.     IF FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE THEN
  28.  
  29. pmCourteous                        EQU        0                    ;Record use of color on each device touched.
  30. pmTolerant                        EQU        $0002                ;render ciRGB if ciTolerance is exceeded by best match.
  31. pmAnimated                        EQU        $0004                ;reserve an index on each device touched and render ciRGB.
  32. pmExplicit                        EQU        $0008                ;no reserve, no render, no record; stuff index into port.
  33. pmWhite                            EQU        $0010
  34. pmBlack                            EQU        $0020
  35. pmInhibitG2                        EQU        $0100
  36. pmInhibitC2                        EQU        $0200
  37. pmInhibitG4                        EQU        $0400
  38. pmInhibitC4                        EQU        $0800
  39. pmInhibitG8                        EQU        $1000
  40. pmInhibitC8                        EQU        $2000                ; NSetPalette Update Constants 
  41. pmNoUpdates                        EQU        $8000                ;no updates
  42. pmBkUpdates                        EQU        $A000                ;background updates only
  43. pmFgUpdates                        EQU        $C000                ;foreground updates only
  44. pmAllUpdates                    EQU        $E000                ;all updates
  45. ColorInfo                RECORD 0
  46. ciRGB                     ds        RGBColor        ; offset: $0 (0)        ; true RGB values
  47. ciUsage                     ds.w    1                ; offset: $6 (6)        ; color usage
  48. ciTolerance                 ds.w    1                ; offset: $8 (8)        ; tolerance value
  49. ciDataFields             ds.w    3                ; offset: $A (10)        ; private fields
  50. sizeof                     EQU *                    ; size:   $10 (16)
  51.                         ENDR
  52. ; typedef struct ColorInfo *            ColorInfoPtr
  53.  
  54. ; typedef ColorInfoPtr *                ColorInfoHandle
  55.  
  56. Palette                    RECORD 0
  57. pmEntries                 ds.w    1                ; offset: $0 (0)        ; entries in pmTable
  58. pmDataFields             ds.w    7                ; offset: $2 (2)        ; private fields
  59. pmInfo                     ds        ColorInfo        ; offset: $10 (16) <-- really an array of length one
  60. sizeof                     EQU *                    ; size:   $20 (32)
  61.                         ENDR
  62. ; typedef struct Palette *                PalettePtr
  63.  
  64. ; typedef PalettePtr *                    PaletteHandle
  65.  
  66. ;
  67. ; pascal void InitPalettes(void )
  68. ;
  69.     IF ¨ GENERATINGCFM THEN
  70.         _InitPalettes:    OPWORD    $AA90
  71.     ELSE
  72.         IMPORT_CFM_FUNCTION InitPalettes
  73.     ENDIF
  74.  
  75. ;
  76. ; pascal PaletteHandle NewPalette(short entries, CTabHandle srcColors, short srcUsage, short srcTolerance)
  77. ;
  78.     IF ¨ GENERATINGCFM THEN
  79.         _NewPalette:    OPWORD    $AA91
  80.     ELSE
  81.         IMPORT_CFM_FUNCTION NewPalette
  82.     ENDIF
  83.  
  84. ;
  85. ; pascal PaletteHandle GetNewPalette(short PaletteID)
  86. ;
  87.     IF ¨ GENERATINGCFM THEN
  88.         _GetNewPalette:    OPWORD    $AA92
  89.     ELSE
  90.         IMPORT_CFM_FUNCTION GetNewPalette
  91.     ENDIF
  92.  
  93. ;
  94. ; pascal void DisposePalette(PaletteHandle srcPalette)
  95. ;
  96.     IF ¨ GENERATINGCFM THEN
  97.         _DisposePalette:    OPWORD    $AA93
  98.     ELSE
  99.         IMPORT_CFM_FUNCTION DisposePalette
  100.     ENDIF
  101.  
  102. ;
  103. ; pascal void ActivatePalette(WindowPtr srcWindow)
  104. ;
  105.     IF ¨ GENERATINGCFM THEN
  106.         _ActivatePalette:    OPWORD    $AA94
  107.     ELSE
  108.         IMPORT_CFM_FUNCTION ActivatePalette
  109.     ENDIF
  110.  
  111. ;
  112. ; pascal void SetPalette(WindowPtr dstWindow, PaletteHandle srcPalette, Boolean cUpdates)
  113. ;
  114.     IF ¨ GENERATINGCFM THEN
  115.         _SetPalette:    OPWORD    $AA95
  116.     ELSE
  117.         IMPORT_CFM_FUNCTION SetPalette
  118.     ENDIF
  119.  
  120. ;
  121. ; pascal void NSetPalette(WindowPtr dstWindow, PaletteHandle srcPalette, short nCUpdates)
  122. ;
  123.     IF ¨ GENERATINGCFM THEN
  124.         _NSetPalette:    OPWORD    $AA95
  125.     ELSE
  126.         IMPORT_CFM_FUNCTION NSetPalette
  127.     ENDIF
  128.  
  129. ;
  130. ; pascal PaletteHandle GetPalette(WindowPtr srcWindow)
  131. ;
  132.     IF ¨ GENERATINGCFM THEN
  133.         _GetPalette:    OPWORD    $AA96
  134.     ELSE
  135.         IMPORT_CFM_FUNCTION GetPalette
  136.     ENDIF
  137.  
  138. ;
  139. ; pascal void CopyPalette(PaletteHandle srcPalette, PaletteHandle dstPalette, short srcEntry, short dstEntry, short dstLength)
  140. ;
  141.     IF ¨ GENERATINGCFM THEN
  142.         _CopyPalette:    OPWORD    $AAA1
  143.     ELSE
  144.         IMPORT_CFM_FUNCTION CopyPalette
  145.     ENDIF
  146.  
  147. ;
  148. ; pascal void PmForeColor(short dstEntry)
  149. ;
  150.     IF ¨ GENERATINGCFM THEN
  151.         _PmForeColor:    OPWORD    $AA97
  152.     ELSE
  153.         IMPORT_CFM_FUNCTION PmForeColor
  154.     ENDIF
  155.  
  156. ;
  157. ; pascal void PmBackColor(short dstEntry)
  158. ;
  159.     IF ¨ GENERATINGCFM THEN
  160.         _PmBackColor:    OPWORD    $AA98
  161.     ELSE
  162.         IMPORT_CFM_FUNCTION PmBackColor
  163.     ENDIF
  164.  
  165. ;
  166. ; pascal void AnimateEntry(WindowPtr dstWindow, short dstEntry, const RGBColor *srcRGB)
  167. ;
  168.     IF ¨ GENERATINGCFM THEN
  169.         _AnimateEntry:    OPWORD    $AA99
  170.     ELSE
  171.         IMPORT_CFM_FUNCTION AnimateEntry
  172.     ENDIF
  173.  
  174. ;
  175. ; pascal void AnimatePalette(WindowPtr dstWindow, CTabHandle srcCTab, short srcIndex, short dstEntry, short dstLength)
  176. ;
  177.     IF ¨ GENERATINGCFM THEN
  178.         _AnimatePalette:    OPWORD    $AA9A
  179.     ELSE
  180.         IMPORT_CFM_FUNCTION AnimatePalette
  181.     ENDIF
  182.  
  183. ;
  184. ; pascal void GetEntryColor(PaletteHandle srcPalette, short srcEntry, RGBColor *dstRGB)
  185. ;
  186.     IF ¨ GENERATINGCFM THEN
  187.         _GetEntryColor:    OPWORD    $AA9B
  188.     ELSE
  189.         IMPORT_CFM_FUNCTION GetEntryColor
  190.     ENDIF
  191.  
  192. ;
  193. ; pascal void SetEntryColor(PaletteHandle dstPalette, short dstEntry, const RGBColor *srcRGB)
  194. ;
  195.     IF ¨ GENERATINGCFM THEN
  196.         _SetEntryColor:    OPWORD    $AA9C
  197.     ELSE
  198.         IMPORT_CFM_FUNCTION SetEntryColor
  199.     ENDIF
  200.  
  201. ;
  202. ; pascal void GetEntryUsage(PaletteHandle srcPalette, short srcEntry, short *dstUsage, short *dstTolerance)
  203. ;
  204.     IF ¨ GENERATINGCFM THEN
  205.         _GetEntryUsage:    OPWORD    $AA9D
  206.     ELSE
  207.         IMPORT_CFM_FUNCTION GetEntryUsage
  208.     ENDIF
  209.  
  210. ;
  211. ; pascal void SetEntryUsage(PaletteHandle dstPalette, short dstEntry, short srcUsage, short srcTolerance)
  212. ;
  213.     IF ¨ GENERATINGCFM THEN
  214.         _SetEntryUsage:    OPWORD    $AA9E
  215.     ELSE
  216.         IMPORT_CFM_FUNCTION SetEntryUsage
  217.     ENDIF
  218.  
  219. ;
  220. ; pascal void CTab2Palette(CTabHandle srcCTab, PaletteHandle dstPalette, short srcUsage, short srcTolerance)
  221. ;
  222.     IF ¨ GENERATINGCFM THEN
  223.         _CTab2Palette:    OPWORD    $AA9F
  224.     ELSE
  225.         IMPORT_CFM_FUNCTION CTab2Palette
  226.     ENDIF
  227.  
  228. ;
  229. ; pascal void Palette2CTab(PaletteHandle srcPalette, CTabHandle dstCTab)
  230. ;
  231.     IF ¨ GENERATINGCFM THEN
  232.         _Palette2CTab:    OPWORD    $AAA0
  233.     ELSE
  234.         IMPORT_CFM_FUNCTION Palette2CTab
  235.     ENDIF
  236.  
  237. ;
  238. ; pascal long Entry2Index(short entry)
  239. ;
  240.     IF ¨ GENERATINGCFM THEN
  241.         Macro
  242.         _Entry2Index
  243.             moveq               #0,D0
  244.             dc.w                $AAA2
  245.         EndM
  246.     ELSE
  247.         IMPORT_CFM_FUNCTION Entry2Index
  248.     ENDIF
  249.  
  250. ;
  251. ; pascal void RestoreDeviceClut(GDHandle gd)
  252. ;
  253.     IF ¨ GENERATINGCFM THEN
  254.         Macro
  255.         _RestoreDeviceClut
  256.             moveq               #2,D0
  257.             dc.w                $AAA2
  258.         EndM
  259.     ELSE
  260.         IMPORT_CFM_FUNCTION RestoreDeviceClut
  261.     ENDIF
  262.  
  263. ;
  264. ; pascal void ResizePalette(PaletteHandle p, short size)
  265. ;
  266.     IF ¨ GENERATINGCFM THEN
  267.         Macro
  268.         _ResizePalette
  269.             moveq               #3,D0
  270.             dc.w                $AAA2
  271.         EndM
  272.     ELSE
  273.         IMPORT_CFM_FUNCTION ResizePalette
  274.     ENDIF
  275.  
  276. ;
  277. ; pascal void SaveFore(ColorSpec *c)
  278. ;
  279.     IF ¨ GENERATINGCFM THEN
  280.         Macro
  281.         _SaveFore
  282.             move.w              #$040D,D0
  283.             dc.w                $AAA2
  284.         EndM
  285.     ELSE
  286.         IMPORT_CFM_FUNCTION SaveFore
  287.     ENDIF
  288.  
  289. ;
  290. ; pascal void SaveBack(ColorSpec *c)
  291. ;
  292.     IF ¨ GENERATINGCFM THEN
  293.         Macro
  294.         _SaveBack
  295.             move.w              #$040E,D0
  296.             dc.w                $AAA2
  297.         EndM
  298.     ELSE
  299.         IMPORT_CFM_FUNCTION SaveBack
  300.     ENDIF
  301.  
  302. ;
  303. ; pascal void RestoreFore(const ColorSpec *c)
  304. ;
  305.     IF ¨ GENERATINGCFM THEN
  306.         Macro
  307.         _RestoreFore
  308.             move.w              #$040F,D0
  309.             dc.w                $AAA2
  310.         EndM
  311.     ELSE
  312.         IMPORT_CFM_FUNCTION RestoreFore
  313.     ENDIF
  314.  
  315. ;
  316. ; pascal void RestoreBack(const ColorSpec *c)
  317. ;
  318.     IF ¨ GENERATINGCFM THEN
  319.         Macro
  320.         _RestoreBack
  321.             move.w              #$0410,D0
  322.             dc.w                $AAA2
  323.         EndM
  324.     ELSE
  325.         IMPORT_CFM_FUNCTION RestoreBack
  326.     ENDIF
  327.  
  328. ;
  329. ; pascal OSErr SetDepth(GDHandle gd, short depth, short whichFlags, short flags)
  330. ;
  331.     IF ¨ GENERATINGCFM THEN
  332.         Macro
  333.         _SetDepth
  334.             move.w              #$0A13,D0
  335.             dc.w                $AAA2
  336.         EndM
  337.     ELSE
  338.         IMPORT_CFM_FUNCTION SetDepth
  339.     ENDIF
  340.  
  341. ;
  342. ; pascal short HasDepth(GDHandle gd, short depth, short whichFlags, short flags)
  343. ;
  344.     IF ¨ GENERATINGCFM THEN
  345.         Macro
  346.         _HasDepth
  347.             move.w              #$0A14,D0
  348.             dc.w                $AAA2
  349.         EndM
  350.     ELSE
  351.         IMPORT_CFM_FUNCTION HasDepth
  352.     ENDIF
  353.  
  354. ;
  355. ; pascal short PMgrVersion(void )
  356. ;
  357.     IF ¨ GENERATINGCFM THEN
  358.         Macro
  359.         _PMgrVersion
  360.             moveq               #21,D0
  361.             dc.w                $AAA2
  362.         EndM
  363.     ELSE
  364.         IMPORT_CFM_FUNCTION PMgrVersion
  365.     ENDIF
  366.  
  367. ;
  368. ; pascal void SetPaletteUpdates(PaletteHandle p, short updates)
  369. ;
  370.     IF ¨ GENERATINGCFM THEN
  371.         Macro
  372.         _SetPaletteUpdates
  373.             move.w              #$0616,D0
  374.             dc.w                $AAA2
  375.         EndM
  376.     ELSE
  377.         IMPORT_CFM_FUNCTION SetPaletteUpdates
  378.     ENDIF
  379.  
  380. ;
  381. ; pascal short GetPaletteUpdates(PaletteHandle p)
  382. ;
  383.     IF ¨ GENERATINGCFM THEN
  384.         Macro
  385.         _GetPaletteUpdates
  386.             move.w              #$0417,D0
  387.             dc.w                $AAA2
  388.         EndM
  389.     ELSE
  390.         IMPORT_CFM_FUNCTION GetPaletteUpdates
  391.     ENDIF
  392.  
  393. ;
  394. ; pascal Boolean GetGray(GDHandle device, const RGBColor *backGround, RGBColor *foreGround)
  395. ;
  396.     IF ¨ GENERATINGCFM THEN
  397.         Macro
  398.         _GetGray
  399.             move.w              #$0C19,D0
  400.             dc.w                $AAA2
  401.         EndM
  402.     ELSE
  403.         IMPORT_CFM_FUNCTION GetGray
  404.     ENDIF
  405.  
  406.     ENDIF
  407.     ENDIF ; __PALETTES__ 
  408.  
  409.